const fs = require('fs')
const zlib = require('zlib')

const gzip = zlib.createGzip() // 使用 gzip（压缩算法）将数据压缩到流中

const inFile = fs.createReadStream('./data.txt')
const out = fs.createWriteStream('./data.txt.gz')

inFile.pipe(gzip).pipe(out)


